Skip to content

fix ontology explorer active parent nav#27461

Merged
anuj-kumary merged 10 commits intomainfrom
ontology-sidebar-active
Apr 19, 2026
Merged

fix ontology explorer active parent nav#27461
anuj-kumary merged 10 commits intomainfrom
ontology-sidebar-active

Conversation

@anuj-kumary
Copy link
Copy Markdown
Member

@anuj-kumary anuj-kumary commented Apr 17, 2026

Describe your changes:

When navigating to the Ontology Explorer, "Govern" is not highlighted in the parent sidebar

Screen.Recording.2026-04-17.at.2.40.21.PM.mov

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Summary by Gitar

  • Code structure and architecture:
    • Abstracted core logic into useOntologyExplorer and useOntologyGraphDerived hooks for better state management.
    • Created graphBuilders utility to encapsulate graph generation and metric integration logic.
  • UI and navigation improvements:
    • Implemented GraphEmptyState to handle various empty graph scenarios with clearer user feedback.
    • Added ONTOLOGY_EXPLORER route to sidebar navigation for easier access.
  • Performance and data handling:
    • Optimized data fetching and rendering by introducing pagination and batching for glossary terms and asset counts.
    • Implemented node position persistence when switching between views in data mode.

This will update automatically on new commits.

@anuj-kumary anuj-kumary requested a review from a team as a code owner April 17, 2026 09:09
@anuj-kumary anuj-kumary added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Apr 17, 2026
@anuj-kumary anuj-kumary self-assigned this Apr 17, 2026
siddhant1
siddhant1 previously approved these changes Apr 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.71% (59705/93706) 43.65% (31456/72049) 46.73% (9446/20212)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

🟡 Playwright Results — all passed (17 flaky)

✅ 3668 passed · ❌ 0 failed · 🟡 17 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 478 0 2 4
🟡 Shard 2 647 0 4 7
🟡 Shard 3 655 0 5 1
🟡 Shard 4 630 0 4 27
✅ Shard 5 611 0 0 42
🟡 Shard 6 647 0 2 8
🟡 17 flaky test(s) (passed on retry)
  • Features/CustomizeDetailPage.spec.ts › Glossary Term - customization should work (shard 1, 1 retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/ChangeSummaryBadge.spec.ts › Automated badge should appear on entity description with Automated source (shard 2, 1 retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › Admin: Complete export-import-validate flow (shard 2, 1 retry)
  • Features/DataQuality/TestCaseResultPermissions.spec.ts › User with only VIEW cannot PATCH results (shard 2, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for MlModel (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Domain announcement create, edit & delete (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Tag Add, Update and Remove (shard 4, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Rohit0301
Rohit0301 previously approved these changes Apr 17, 2026
Rohit0301
Rohit0301 previously approved these changes Apr 17, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 18, 2026

Code Review ✅ Approved 2 resolved / 2 findings

Fixes ontology explorer active parent navigation by extracting duplicate style-stripping logic and restoring baked positions in the data mode branch.

✅ 2 resolved
Bug: Asset/metric nodes lose baked positions in data mode branch

📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/hooks/useOntologyGraph.ts:1718-1732
When isDataMode && !termFingerprintChanged && preUpdateTermPositions has entries (lines 1713-1737), only term nodes present in preUpdateTermPositions receive position updates. Asset and metric nodes are explicitly excluded from preUpdateTermPositions (line 1688 filters them out), so they are mapped to null and filtered away. This means applyBakedPositions is never called for asset/metric nodes in this branch — they may render at default (0,0) or stale positions after a setData call resets the graph.

The fix should apply baked positions for non-term nodes that aren't in the snapshot, or merge both sets of updates.

Quality: Duplicated style-stripping logic should be extracted to helper

📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/hooks/useOntologyGraph.ts:1440-1450 📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/hooks/useOntologyGraph.ts:1628-1638
The same block of code that strips x/y from node styles in data mode is duplicated verbatim at lines 1440-1450 and 1628-1638. Extracting this into a small helper function (e.g., stripNodePositionsForDataMode(nodes)) would reduce duplication and make future changes less error-prone.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

@anuj-kumary anuj-kumary merged commit ec556d5 into main Apr 19, 2026
56 of 57 checks passed
@anuj-kumary anuj-kumary deleted the ontology-sidebar-active branch April 19, 2026 18:26
anuj-kumary added a commit that referenced this pull request Apr 20, 2026
* fix ontology explorer active parent nav

* fix data mode position issue

* Addreesed comments

* Refactor code

* fix lint issue

(cherry picked from commit ec556d5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants